package net.dopan.pigframe.demo.model.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * @author wufeihong
 * 用户活动表
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("user_activity" )
public class UserActivity extends Model<UserActivity> {

    private static final long serialVersionUID = 1L;

    /**
     * 活动Id
     */

    @NotNull
    @TableId(value = "activity_id", type = IdType.INPUT)
    private long activityId;

    @NotBlank(message = "活动名称不能为空!" )
    @TableField("activity_name" )
    private String activityName;
    /**
     * 活动费用
     */
    @TableField("activity_cost" )
    private String activityCost;

    @TableField("activity_detail" )
    private String activityDetail;

    @TableField("cover_photo_url" )
    private String coverPhotoUrl;
    @NotNull
    private String username;
    @TableField("user_id" )
    @NotNull
    private long userId;

    @TableField("people_number" )
    private long peopleNumber;
    /**
     * 活动类型
     */
    @NotNull
    @TableField("classify_id" )
    private long classifyId;
    /**
     * 审核标记 0未通过 1通过
     */
    private byte auditing;
    /**
     * 热门标记 0非热门 1热门
     */
    private byte hot;
    /** 创建时间 */
    @TableField("create_time" )
    private Date createTime;

    /** 经度 **/
    private String longitude;
    /** 纬度 **/
    private String latitude;
    /** 省 **/
    private String province;
    /** 市 **/
    private String city;
    /** 区 **/
    private String area;

    @TableField("like_num" )
    private Integer likeNum;
    @TableField("collect_num" )
    private Integer collectNum;
    @TableField("comment_num" )
    private Integer commentNum;
    /** 发布标记 1 为活动 2为笔记 */
    @TableField("type_flag" )
    private Integer typeFlag;

    @Override
    protected Serializable pkVal() {
        return this.activityId;
    }
}
